import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '订单号',
    align: "center",
    dataIndex: 'orderNo'
  },
  {
    title: '保单号',
    align: "center",
    dataIndex: 'policyNo'
  },
  {
    title: '区域',
    align: "center",
    dataIndex: 'areaId'
  },
  {
    title: '付款人名称',
    align: "center",
    dataIndex: 'payAccountName'
  },

  {
    title: '订单来源',
    align: "center",
    dataIndex: 'orderSource_dictText'
  },
  {
    title: '退款状态',
    align: "center",
    dataIndex: 'refundState_dictText'
  },
  {
    title: '保险公司',
    align: "center",
    dataIndex: 'insuranceCompany'
  },
  {
    title: '出保时间',
    align: "center",
    dataIndex: 'insureActiveDate'
  },
  {
    title: '退保时间',
    align: "center",
    dataIndex: 'surrenderTime'
  },
  {
    title: '退款时间',
    align: "center",
    dataIndex: 'refundDate'
  },
  {
    title: '退款金额',
    align: "center",
    dataIndex: 'amount'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "订单号",
    field: 'orderNo',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "保单号",
    field: 'policyNo',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "区域",
    field: 'areaId',
    component: 'JSelectDept',
    colProps: {span: 6},
  },
  {
    label: "订单来源",
    field: 'orderSource',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "PPYWLX"
    },
    colProps: {span: 6},
  },
  {
    label: "退款状态",
    field: 'refundState',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "保险公司",
    field: 'insuranceCompany',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "出保时间",
    field: "insureActiveDate",
    component: 'RangePicker',
    colProps: {span: 6},
  },
  {
    label: "退保时间",
    field: "surrenderTime",
    component: 'RangePicker',
    colProps: {span: 6},
  },
  {
    label: "退款时间",
    field: "refundDate",
    component: 'RangePicker',
    colProps: {span: 6},
  },
  {
    label: "付款人名称",
    field: 'payAccountName',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '交易流水号',
    field: 'refundFlowNo',
    component: 'Input',
  },
  {
    label: '平台退款流水号',
    field: 'refundPlatformNo',
    component: 'Input',
  },
  {
    label: '银行退款流水号',
    field: 'refundBankNo',
    component: 'Input',
  },
  {
    label: '订单号',
    field: 'orderNo',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入订单号!'},
             ];
    },
  },
  {
    label: '保单号',
    field: 'policyNo',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入保单号!'},
             ];
    },
  },
  {
    label: '区域',
    field: 'areaId',
    component: 'JSelectDept',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入区域!'},
             ];
    },
  },
  {
    label: '订单来源',
    field: 'orderSource',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "PPYWLX"
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入订单来源!'},
             ];
    },
  },
  {
    label: '退款状态',
    field: 'refundState',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入退款状态!'},
             ];
    },
  },
  {
    label: '保险公司',
    field: 'insuranceCompany',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入保险公司!'},
             ];
    },
  },
  {
    label: '出保时间',
    field: 'insureActiveDate',
    component: 'DatePicker',
  },
  {
    label: '退保时间',
    field: 'surrenderTime',
    component: 'DatePicker',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入退保时间!'},
             ];
    },
  },
  {
    label: '退款时间',
    field: 'refundDate',
    component: 'DatePicker',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入退款时间!'},
             ];
    },
  },
  {
    label: '付款人账号',
    field: 'payAccount',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入付款人账号!'},
             ];
    },
  },
  {
    label: '付款人名称',
    field: 'payAccountName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入付款人名称!'},
             ];
    },
  },
  {
    label: '付款人银行名称',
    field: 'partyBankName',
    component: 'Input',
  },
  {
    label: '退款金额',
    field: 'amount',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入退款金额!'},
             ];
    },
  },
  {
    label: '退款手续费',
    field: 'tranFee',
    component: 'InputNumber',
  },
  {
    label: '退款银行类型',
    field: 'refundBankType',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入退款银行类型!'},
             ];
    },
  },
  {
    label: '退款联行号',
    field: 'unionBankNo',
    component: 'Input',
  },
  {
    label: '退款联行名称',
    field: 'unionBankName',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
